/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.aliyuncs.drds.transform.v20150413;

import java.util.ArrayList;
import java.util.List;

import com.aliyuncs.drds.model.v20150413.ListUnCompleteTasksResponse;
import com.aliyuncs.drds.model.v20150413.ListUnCompleteTasksResponse.task;
import com.aliyuncs.transform.UnmarshallerContext;


public class ListUnCompleteTasksResponseUnmarshaller {

	public static ListUnCompleteTasksResponse unmarshall(ListUnCompleteTasksResponse listUnCompleteTasksResponse, UnmarshallerContext context) {
		

		List<task> data = new ArrayList<task>();
		for (int i = 0; i < context.lengthValue("ListUnCompleteTasksResponse.Data.Length"); i++) {
			task task = new task();
			task.setRequestId(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].RequestId"));
			task.setTargetId(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].TargetId"));
			task.setTaskDetail(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].TaskDetail"));
			task.settaskStatus(context.integerValue("ListUnCompleteTasksResponse.Data["+ i +"].taskStatus"));
			task.setTaskPhase(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].TaskPhase"));
			task.setTaskType(context.integerValue("ListUnCompleteTasksResponse.Data["+ i +"].TaskType"));
			task.setTaskName(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].TaskName"));
			task.setgmtCreate(context.longValue("ListUnCompleteTasksResponse.Data["+ i +"].gmtCreate"));
			task.setAllowCancel(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].AllowCancel"));
			task.setErrMsg(context.stringValue("ListUnCompleteTasksResponse.Data["+ i +"].ErrMsg"));

			data.add(task);
		}
		listUnCompleteTasksResponse.setData(data);
	 
	 	return listUnCompleteTasksResponse;
	}
}